package com.CMC.yhdeng;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.CMC.yhdeng.QuizBaseActivity.QuizMode;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	}

//	@Override
//	public boolean onCreateOptionsMenu(Menu menu) {
//		// Inflate the menu; this adds items to the action bar if it is present.
//		getMenuInflater().inflate(R.menu.main, menu);
//		return true;
//	}
	
	public void onButtonClick(View v)
	{
		Intent intent=null;
		QuizMode type=QuizMode.QM_Unknow;
		switch (v.getId()) {
		case R.id.btnHistory:
			intent = new Intent(this, HistoryActivity.class);
			type=QuizMode.QM_History;
			break;
		case R.id.btnPractice:
			intent=new Intent(this, QuizTypeSelection.class);
			type=QuizMode.QM_Practice;
			break;
		case R.id.btnTest:
			intent=new Intent(this, QuizTypeSelection.class);
			type=QuizMode.QM_Test;
			break;
		default:
			break;
		}
		String sType=getString(R.string.intent_type);
		intent.putExtra(sType, type);
		startActivity(intent);
	}

}
